package janela;

import java.awt.BorderLayout;

import javax.media.opengl.GLCanvas;
import javax.media.opengl.GLCapabilities;
import javax.swing.JFrame;

import cena.Cenario;

public class JanelaN4 extends JFrame {

	private static final long serialVersionUID = 1L;
	private Cenario cenario;

	public JanelaN4() {

		super("Trabalho N4");
		setBounds(400, 100, 800, 622);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		getContentPane().setLayout(new BorderLayout());

		GLCapabilities capabilites = new GLCapabilities();
		capabilites.setRedBits(8);
		capabilites.setGreenBits(8);
		capabilites.setBlueBits(8);
		capabilites.setAlphaBits(8);

		GLCanvas canvas = new GLCanvas(capabilites);
		cenario = new Cenario();

		canvas.addGLEventListener(cenario);
		canvas.addKeyListener(cenario);
		add(canvas, BorderLayout.CENTER);
		canvas.requestFocus();
	}

	public static void main(String[] args) {
		new JanelaN4().setVisible(true);
	}

}
